﻿using PowerVSharp.Core.Utils;
using PowerVSharp.Standard.Interfaces;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;

namespace PowerVSharp.Standard
{
    [Guid("62FBAF00-7D9B-428E-B6B2-BA6C1C730732")]
    [ComVisible(false)]
    internal class Array : IArray
    {
        public dynamic Sort(dynamic origin_array)
        {
            var cliArray = (object[])DynamicHelper.DynamicToArray(origin_array);
            var list = new List<object>(cliArray);
            list.Sort();
            return list.ToArray();
        }

        public int GetLength(dynamic array1d)
        {
            var cliArray = (object[])DynamicHelper.DynamicToArray(array1d);
            return cliArray.Length;
        }


    }
}
